<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;

class BannerController extends Controller
{
    //广告
    public function lists(){
    	$banner_lists = Db::table('banner')->orderBy('order','DESC')->get();

    	foreach ($banner_lists as $key => $value) {
    		$value->image = asset(Storage::url($value->image));
    	}

        return response()->json(['code'=>'1','data'=>$banner_lists]);
    }
}
